package.path = './lib/?.lua;./lib/?/init.lua;./vendor/?.lua;./vendor/?/init.lua;' .. package.path
local luafcgi = require('luafcgi')
local config = require('config')
function main(env, con)
	local app = luafcgi.app:new(env, con)
	app.global['config'] = config
	app:set_route('GET', '/test/memcache', require('test').memcache)	
	app:set_route('GET', '/test', require('test').index)
	app:set_route('GET', '/404', require('errorpage').code404)

	app:get("/", function()
	  return "Hello, World" .. config.db.host
	end)

	app:get("/h/:name", function()
	  return "Hello, " .. params.name;
	end)

	app:get("/age/:age", function(age)
	  return "You are " .. tostring(age) .. " years old."
	end)

	app:run(env, con)

end
